from threading import Thread, Lock


lock = Lock()
a = b = 1


def value():
    while True:
        lock.acquire()
        if a != b:
            print(a, b)
        lock.release()

